package solution.T0215_1_Clipboard;

import solution.T0215_1_Clipboard.command.CopyCommand;

import java.util.List;

public class Clipboard {
    private String content = "";
    private final CopyHistory copyHistory = new CopyHistory();

    private static final Clipboard instance = new Clipboard();

    private Clipboard() {}

    public static Clipboard getInstance() {
        return instance;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void addHistory(CopyCommand command) {
        copyHistory.add(command);
    }

    public CopyCommand getCommandById(int id) {
        return copyHistory.getById(id);
    }

    public List<CopyCommand> getHistory(String keyword) {
        return copyHistory.getHistory(keyword);
    }

    public void clearHistory() {
        copyHistory.clear();
    }
}
